<link href="__PUBLIC__/themes/blue/layout.css" rel="stylesheet" type="text/css" />

<style>
.tdbor td {
	border-bottom:1px dashed #DDDDDD;
	color:#666666;
	padding:3px 0
}
</style>
<table width="95%" cellpadding="0" cellspacing="0">
    <tr class="tdbor_b">
        <td width="50">反选<input type="checkbox" name="all" onclick="dealAll()"></td>
        <td align="center" width="15%" >ID</td>
        <td>标题</td>
    </tr>
    <volist name='data' id='vo'>
        <tr class="tdbor">
            <td height="30"><input type="checkbox" name="idArr[]" value="{$vo.id}" onclick="parent.dealId({$vo.id})"></td>
            <td height="30" width="15%" align="center">{$vo.id}</td>
            <td height="30">{$vo.title}</td>
        </tr>
    </volist>
    <tr>
        <td colspan="3"><div class="page mt10 R mb10">{$list.html}</div></td>
    </tr>
</table>
<script type="text/javascript" src="__PUBLIC__/js/jquery.js"></script>
<script type="text/javascript">
$(function(){		   
	var ids = parent.idArr;
	$("input[name='idArr[]']").each(function(){
		var id = $(this).val();
		id     =  parseInt(id);
		if(jQuery.inArray( id , ids)!=-1){
			$(this).attr('checked', true);
		}
	});		   
});

function dealAll(){
	$("input[name='idArr[]']").each(function(){
		var ids = parent.idArr;
		var id = $(this).val();
		id     =  parseInt(id);
		
		if(jQuery.inArray( id , ids)!=-1){
			$(this).attr('checked', false);
		}else{
			$(this).attr('checked', true);
		}
		
		parent.dealId(id);
	});		
}
</script>